package com.jrx.anytxn.reporting.job.xib.step;

import com.jrx.anytxn.reporting.entity.CmInteCoLonRepayDtl;
import com.jrx.anytxn.reporting.mapper.base.CmInteCoLonRepayDtlMapper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.batch.item.ItemWriter;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RepayDtlWriter implements ItemWriter<CmInteCoLonRepayDtl> {

    @Resource
    private CmInteCoLonRepayDtlMapper cmInteCoLonRepayDtlMapper;

    @Override
    public void write(List<? extends CmInteCoLonRepayDtl> items) {
        if(CollectionUtils.isNotEmpty(items)){
            for(CmInteCoLonRepayDtl ddtl : items){
                cmInteCoLonRepayDtlMapper.insertSelective(ddtl);
            }
        }
    }
}
